﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Futaba.SBus
{
	internal static class LoggingService
	{
		public static readonly TraceSource Log = new TraceSource(typeof(LoggingService).Namespace, SourceLevels.Warning);

		public static int ParsingErrorEventId = 101;
		public static int DataOutOfSyncEventId = 102;
		public static int InvalidSlotEventId = 103;

		public static void LogException(Exception ex, int eventId, string msg, params object[] args)
		{
			Log.TraceEvent(TraceEventType.Error, eventId, msg, args);
			Log.TraceEvent(TraceEventType.Verbose, eventId, ex.ToString());
		}
	}
}
